package project.product.web;

import kernel.web.Page;
import kernel.web.PageActionSupport;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import project.product.Brand;
import project.product.BrandService;
import project.product.ClothService;

public class ClothAction extends PageActionSupport {
    

    /**	
     * Member Description
     */
    
    private static final long serialVersionUID = -452790511816887364L;

    private static final Log logger = LogFactory.getLog(BrandAction.class);
    
    private String brand_id;
    
    private Brand brand;

    private ClothService clothService;
    
    private BrandService brandService;
    
    private String uuid;

    public String view() {
        page = Page.EMPTY_PAGE;
        page.setElements( clothService.findByBrandId(brand_id));
        super.page = page;
        this.tabs = this.bulidTabs();
        return "view";
    }
    

    public String praise(){
        clothService.addPraise(uuid);
        view();
        return "view"; 
    }
    
    public String go(){
        
        
        
        return "view";  
    }

    public String getBrand_id() {
        return brand_id;
    }

    public void setBrand_id(String brand_id) {
        this.brand_id = brand_id;
    }

    public void setClothService(ClothService clothService) {
        this.clothService = clothService;
    }

    public Brand getBrand() {
        if (brand ==  null) {
            brand =   brandService.getBrand(brand_id);
        }
        return brand;
    }

    public void setBrandService(BrandService brandService) {
        this.brandService = brandService;
    }


    public String getUuid() {
        return uuid;
    }


    public void setUuid(String uuid) {
        this.uuid = uuid;
    }




}
